<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<style>
	.modal-dialog {
		width: 80%!important;
	}
</style>

<div class="main-container" id="main-container" style="overflow-x: hidden">
    <script type="text/javascript">
        try{ace.settings.check('main-container' , 'fixed')}catch(e){}
    </script>

    <!-- /section:basics/sidebar -->
    <div class="main-content" >
        <div class="main-content-inner">
            <div class="page-content">
                <!-- /section:settings.box -->

                <div class="row">
                    <div class="col-xs-12"   >
                        <!-- PAGE CONTENT BEGINS -->
                        <!-- jqGrid表格 -->
                        <table id="gridTable"  ></table>
                        <!-- jqGrid工具类 -->
                        <div id="gridPager"></div>
                        <!-- 查询对话框 -->
                        <div style="display: none;">
                            <div class="row" id="queryDialog"></div>
                        </div>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>


    </div><!-- /.main-content -->

    <%--<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
        <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
    </a>--%>

    <!-- dialog -->
    <%@ include file="/WEB-INF/views/include/dialog.jsp"%>
</div><!-- /.main-container -->


<script type="text/javascript">
    //基本路径
    var baseUrl = "<s:url value="/chart/show"></s:url>/"

    //jqgrid的表格高度
    var height = 320;
    //jqgrid表格行头的中文
    var colNames = ['申报单号','是否审核','首申日期 ','年份','小分队','项目类别', '项目阶段', '项目名称','投资方名称','领导','属地','项目内容和规模','项目进展情况',
        '国别或地区','三维属性','产业分类','具体分类','合计','内资','外资','负责人','分管领导','联系人','企业联系人','注册，备案时间','备注',
       '场地使用方式','实际个数','实际投资额','项目状态'];
    //jqgrid表格中每一行的信息模型
    var colModel = [
        {name:'sysId', index:'sysId',width:200,editable: false,key:true},
        {name:'isaudit',index:'isaudit', width:80,editable: false,formatter:aa10Fmatter},
        {name:'firstReportDate',index:'firstReportDate', width:100,editable: false},
        {name:'datatime',index:'datatime', width:50,editable: true},
        {name:'teamName',index:'teamName', width:160,editable: true},
        {name:'projectClass',index:'projectClass', width:100,editable: true},
        {name:'projectStage',index:'projectStage', width:100, editable: true},
        {name:'projectName',index:'projectName', width:220, editable: true},
        {name:'investorName',index:'investorName', width:220, editable: true},
        {name:'leader',index:'leader', width:100, editable: true},
        {name:'belongArea',index:'belongArea', width:100, editable: true},
        {name:'projectContent',index:'projectContent', width:200, editable: true},
        {name:'projectProgress',index:'projectProgress', width:200, editable: true},
        {name:'area',index:'area', width:140, editable: true},
        {name:'attribute',index:'attribute', width:120, editable: true},
        {name:'industrialClassfly',index:'industrialClassfly', width:80, editable: true},
        {name:'industrialConcrete',index:'industrialConcrete', width:100, editable: true},
        {name:'totalInver',index:'totalInver', width:60, editable: true,formatter:'number'},
        {name:'domesticInver',index:'domesticInver', width:60, editable: true},
        {name:'foeignInver',index:'foeignInver', width:60, editable: true},
        {name:'projectManager',index:'projectManager', width:100, editable: true},
        {name:'fenguanLeader',index:'fenguanLeader', width:100, editable: true},
        {name:'contacts',index:'contacts', width:180, editable: true},
        {name:'companyContacts',index:'companyContacts', width:200, editable: true},
        {name:'registerDate',index:'registerDate', width:220, editable: true},
        {name:'notes',index:'notes',width:220,editable:true},
        {name:'groundused',index:'groundused', width:200, editable: true},
        {name:'realNum',index:'realNum', width:200, editable: true},
        {name:'realInver',index:'realInver', width:200, editable: true},
        {name:'projectStatus',index:'projectStatus',width:200,editable:true},

    ];
    //jqgrid的具体执行方法
    jqgrid({
        shrinkToFit:false,
        gridTableId : "#gridTable",
        gridPagerId : "#gridPager",
        footerrow:true,
        userDataOnFooter:true,
        postData: JSON.parse($("#formDialog-data").val()),
        gridComplete:function () {
            var sumtotal =$("#gridTable").getCol('totalInver',false,'sum');
            var realnumsum=$("#gridTable").getCol('realNum',false,'sum');
            var realInvest=$("#gridTable").getCol('realInver',false,'sum');
            //console.log(sumtotal);
            $("#gridTable").footerData('set',{'totalInver':sumtotal,'realNum':realnumsum,'realInver':realInvest});
        },

    });


    function aa10Fmatter(cellvalue,options,rowObject) {
        if (cellvalue == "1") {
            return "审核通过";
        } else if (cellvalue == "0") {
            return "未审核";
        } else if (cellvalue == "2") {
            return "作废";
        } else if (cellvalue == "3") {
            return "回退";
        }
    }

    function query() {
        seachJqgird("#gridTable","#formDialog form");
        $("#formDialog").modal('hide');
    }


    $("#gridTable").dblclick(function(e){
        showView();
    });
    // 警告框
    function showShade(){
        var $vW = $(window).width();
        var $w = $(".warning").outerWidth();
        var $vH = $(window).height();
        var $h = $(".warning").outerHeight();
        $(".warning").css({"left":($vW - $w)/2 + "px","top":($vH - $h)/3 + "px"});
    };
    //警告框
    $(function(){
        //浏览器大小发生改变
        $(window).resize(function(){
            showShade();
        });
        //点击span关闭
//         $("span").bind("click",function(){
//             $(".shade").fadeOut(100);
//             $(".warning").fadeOut(100);
//         });
//         //绑定键盘事件  按下esc键退出
//         $(document).keyup(function(ev){
// //                alert(ev.keyCode);  获取esc的键码27
//             if(ev.keyCode == 27){
// //                    $("span").click();
//                 //模拟事件
//                 $("span").trigger("click");
//             }
//         })
//         $('.shade').click(function () {
//             $("span").trigger("click");
//         })
    })

</script>